package com.privatetime.service.impl;

import java.util.List;

import com.privatetime.common.exception.UserNotFoundException;
import com.privatetime.dao.UserDao;
import com.privatetime.model.User;
import com.privatetime.service.UserService;

public class UserServiceImpl extends BaseServiceImpl<User, Integer> implements
		UserService {

	private UserDao userDao;

	public void setUserDao(UserDao userDao) {
		super.setBaseDao(userDao);
		this.userDao = userDao;
	}

	public User userLogin(String userName, String passWord)
			throws UserNotFoundException {
		logger.info("UserService...");
		return userDao.userLogin(userName, passWord);
	}

	public void saveUserGroup(User user) throws Exception {
		updateEntity(user);
	}

	public List<User> retrieveUserByGroup(Integer groupId) throws Exception {
		return userDao.queryUserByGroup(groupId);
	}

}
